<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html lang="zh-CN">
	<head>
		<meta charset="utf-8">
		<title><?php echo C('defaultinfo.name');?> - Powered By可用可信HRM</title>
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
		<meta name="description" content=""/>
		<meta name="author" content="可用可信HRM"/>
		<link rel="shortcut icon" href="__PUBLIC__/ico/favicon.png"/>
		<link rel="stylesheet" href="__PUBLIC__/css/bootstrap.css">
		<link rel="stylesheet" href="__PUBLIC__/css/hrms.css">
		<script src="__PUBLIC__/js/jquery.min.js"></script>
		<script src="__PUBLIC__/js/bootstrap.min.js"></script>
		<script src="__PUBLIC__/js/nongli.js"></script>
		<script src="__PUBLIC__/js/calendar.js"></script>
		<!--[if lt IE 9]>
		<script src="__PUBLIC__/js/html5shiv.min.js"></script>
		<script src="__PUBLIC__/js/respond.min.js"></script>
		<![endif]-->
	</head>
	<body>
<link rel="stylesheet" href="__PUBLIC__/css/treeview/jquery.treeview.css" type="text/css">
<link rel="stylesheet" href="__PUBLIC__/css/table.css" type="text/css">
<script type="text/javascript" src="__PUBLIC__/js/treeview/jquery.treeview.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/treeview/jquery.treeview.edit.js"></script>
<script src="__PUBLIC__/js/datepicker/WdatePicker.js"></script>
<script type="text/javascript">
	$(function() {
		$("#browser").treeview();
	})
</script>
<style type="text/css">
.ztree li span.button.add {margin-left:2px; margin-right: -1px; background-position:-144px 0; vertical-align:top; *vertical-align:middle}

.tsubmit{
width:70px;height:30px;background-color:#0789cc;border:hidden;
-moz-box-shadow: 2px 2px 1px #909090;
-webkit-box-shadow: 2px 2px 1px #909090;
box-shadow:2px 2px 1px #909090;
border-radius:10px;
font-family:黑体;
font-size:15px;
color:white;
text-align:center;
}
.tsubmit:hover{
	background-color:#055680;
}

.table_list{
	width:100%;
	background-color:#efdede;
	border:1px solid #CC9999;
}
.table_list tr{
	width:100%;
	background-color:#d8b9b9;
	line-height:40px;
	font-size:12px;
}
.table_list tr:first-child {
	color:#2b1c1c;
	font-family:黑体;
	font-size:15px;
	font-weight:bold;background:#ffffff;border-bottom:1px solid #CC9999;}
.table_list tr:nth-child(2n){background:#f3e8e8;}

.theader{
	width:100%;
	height:40px;
}
.theader ul{
	list-style:none;
	
}
.theader ul li{
	float:left;
	text-align:center;
	line-height:40px;
	width:150px;
	
}
.theader ul a{
	text-decoration:none;
	color:#ffffff;
	font-size:20px;
	font-family:黑体;
	text-shadow:1px 1px 1px dimgray;
	}

.tli{
	background-color:#f3e8e8;
	border-top:1px solid #944949;
	border-left:1px solid #944949;
	border-right:1px solid #944949;
}	
.tcurrent{
	background-color:#CC9999;	
}	
.table_list2{
	width:100%;
	background-color:#8B668B;
	border:1px solid #9b599b;
}
.table_list2 tr{
	width:100%;
	background-color:#d9aed9;
	line-height:40px;
	font-size:12px;
}
table tr td{
	padding-left:5px;
}
.table_list2 tr:first-child {
	color:#2b1c1c;
	font-family:黑体;
	font-size:15px;
	font-weight:bold;background:#ffffff;border-bottom:1px solid #653265;}
.table_list2 tr:nth-child(2n){background:#f3e8e8;}
.tabs{
	display:block;
}
#tabl,#tab2{
	display:none;
}
#tab1:target{
	display:block;
}
#tab2:target{
	display:block;
}

.ebutton{
	width:70px;
	height:25px;
	background-color:#ca7d7d;
	line-height:23px;
	border-radius:6px;
	border:1px solid #964f4f;
	color:#ffffff;
	text-align:center;
}
.ibutton{
	width:70px;
	height:25px;
	background-color:#8c538c;
	line-height:23px;
	border-radius:6px;
	border:1px solid #964f4f;
	color:#ffffff;
	text-align:center;
}
.ibutton:hover{
	background-color:#ecbcec;
}
.look a{
	text-decoration:none;
}
.right_main{
	width:100%;
	height:750px;
	background-color:#f8f9fd;
	border:1px solid #e9edf9;
}
</style>
<?php echo W('Navigation');?>

<div class="body-right">
	<div class="row-table">
		<div class="row-table-title">营业额列表</div>
	</div>
	<div class="right_main">
		<div class="theader">
			
			<ul>
				<a href="<?php echo U('chrm/turnover/table_list','st=turnover');?>" onmouseover="setblock(2)">
					<?php if($path == 'turnover'): ?><li class="tli tcurrent">营业额</li>
					<?php else: ?>
						<li class="tli">营业额</li><?php endif; ?>
				</a>
				<a href="<?php echo U('chrm/turnover/table_list','st=expend');?>" onmouseover="setblock(1)">
					<?php if($path == 'expend'): ?><li class="tli tcurrent">支出</li>
					<?php else: ?>
						<li class="tli">支出</li><?php endif; ?>
					
				</a>
				<a href="<?php echo U('chrm/turnover/table_list','st=income');?>" onmouseover="setblock(2)">
					<?php if($path == 'income'): ?><li class="tli tcurrent">收入</li>
					<?php else: ?>
						<li class="tli">收入</li><?php endif; ?>
				</a>
				<li style="margin-left:50px;height:30px;width:300px;">
					
					<form action="<?php echo U('chrm/turnover/search_list');?>" method="post">
				    	选择日期:
				    	<input type="text" name="tdate" class="form-control" onclick="WdatePicker({dateFmt:'yyyy-MM-dd'})" value="" style="width:120px;"/>
				    	<input type="hidden" name="action" value="<?php echo ($path); ?>" />
				    	<input type="hidden" name="form" value="day" />
				    	<input type="submit" value="查询"  class="btn btn-primary" />
					</form>
				</li>
				<li style="margin-left:10px;height:30px;width:300px;">
					<form action="<?php echo U('chrm/turnover/search_list');?>" method="post">
				    	选择月份:
				    	<input type="text" name="tdate" class="form-control" onclick="WdatePicker({dateFmt:'yyyy-MM'})" value="" style="width:120px;"/>	
				    	<input type="hidden" name="action" value="<?php echo ($path); ?>" />
				    	<input type="hidden" name="form" value="month" />
				    	<input type="submit" value="查询"  class="btn btn-primary" />
					</form>
				</li>
				<li style="float:right;">
					<button class="btn btn-primary" data-am-modal="{target: '#doc-modal-2', closeViaDimmer: 0, width: 400, height: 300}">导出</button>
				</li>
			</ul>
		</div>
	<div id="tab1" >
	<table class="table_list">
			<tr>
				<td>支出日期</td>
				<td>总金额</td>
				<td>团队</td>
				<td>备注</td>
				<td>添加时间</td>
				<td>操作</td>
			</tr>
		<?php if(is_array($list)): $i = 0; $__LIST__ = $list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;?><tr>
				<td><?php echo (date("Y-m-d H:i",$v["total_date"])); ?></td>
				<td><?php echo ($v["money_sum"]); ?></td>
				<td><?php echo ($v["department"]["name"]); ?></td>
				<td><?php echo ($v["desc"]); ?></td>
				<td><?php echo (date("Y-m-d H:i",$v["add_time"])); ?></td>
				<td class="look">
					<a href="<?php echo U('chrm/turnover/expend','total_id='.$v['total_id']);?>" style="float:left;"><div class="ebutton">查看详细</div></a>
				<?php if($path == 'income'): ?><a href="<?php echo U('chrm/turnover/expend_update','total_id='.$v['total_id']);?>"style="float:left;margin-left:20px;" ><div class="ebutton">修改</div></a>
				<?php elseif($path == 'expend'): ?>
					<a href="<?php echo U('chrm/turnover/expend_update','total_id='.$v['total_id']);?>"style="float:left;margin-left:20px;" ><div class="ebutton">修改</div></a>
				<?php elseif($path == 'turnover'): ?>
					<a href="<?php echo U('chrm/turnover/turnover_update','total_id='.$v['total_id']);?>"style="float:left;margin-left:20px;" ><div class="ebutton">修改</div></a><?php endif; ?>
					<a href="<?php echo U('chrm/turnover/total_delete','total_id='.$v['total_id']);?>" onClick="return firm(<?php echo ($v["total_id"]); ?>)" style="float:left;margin-left:20px;" ><div class="ebutton">删除</div></a>
				</td>
			</tr><?php endforeach; endif; else: echo "" ;endif; ?>
			
	</table>
	
	</div>
</div>
	
</div>
<div class="clear"></div>

<script src="http://cdn.bootcss.com/amazeui/2.7.2/js/amazeui.min.js"></script>
<script type="text/javascript">
function g(o){return document.getElementById(o);}
function setblock(n){
	g('tab'+n).className='tabs';
}

    function firm(id)
    {
        if(confirm("你确定要删除吗？"))
        {
           return true;
        }
        else
        {
            return false; 
        }
    }
</script>
<!-- won模态框（Modal） -->
<div class="am-modal am-modal-no-btn" tabindex="-1" id="doc-modal-2" style="display:none;">
	<div class="am-modal-dialog" >
		<div class="am-modal-hd">导出
			<a href="javascript: void(0)" class="am-close am-close-spin" data-am-modal-close>&times;</a>
		</div>
		<form method="post" action="<?php echo U('chrm/turnover/total_export');?>">
			<input type="hidden" name="order_id" value="" id="diaodu_oid" />
			<ul style="margin-top:20px;list-style:none;text-align:left;line-height:30px;">
			
				<li>导出类型：<select id="doc-select-1" name="type">
										<option value="to" selected>营业额</option>
										<option value="expend">支出</option>
										<option value="income">收入</option>
								</select>
				</li>
				<li>导出日期：
									<input type="text" name="tdate" class="form-control" onclick="WdatePicker({dateFmt:'yyyy-MM-dd'})" value="" style="width:120px;"/>	
							
				</li>
				<li>
					日期类型：
						<input type="radio" name="radio" value="1" checked>日</input>
						<input type="radio" name="radio" value="2">月</input>
						<input type="radio" name="radio" value="3">年</input>
				</li>
				
				<li style="margin-top:40px;text-align:center;">
					<button type="submit" class="btn btn-primary">
						&nbsp;确认导出&nbsp;
					</button>
				</li>
			</ul>
			
		</form>
	</div>
</div>
<!-- won模态框（Modal） -->
<div class="modal fade" id="alert" tabindex="-1" data-backdrop="static">
	<div class="modal-dialog">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
				<h4 class="modal-title" id="myModalLabel">提示信息</h4>
			</div>
			<div class="modal-body">
			<?php if(is_array($alert)): foreach($alert as $k=>$v): if(is_array($v)): foreach($v as $kk=>$vv): ?><div class="alert alert-<?php echo ($k); ?>">
					<?php echo ($vv); ?>
				</div><?php endforeach; endif; endforeach; endif; ?>
			</div>
		</div>
	</div>
</div>
<?php if(!empty($alert)): ?><script type="text/javascript">
	$('#alert').modal('show');
	var alert_n = setInterval('$("#alert").modal("hide")',1000);
	$('#alert').on('hide.bs.modal', function (e) {
		clearInterval(alert_n);
	});
</script><?php endif; ?>
		 <div id="footer">
			<div class="container">
				<p class="text-muted credit">
					可用可信HRM © 2016 <a href="http://www.dgpaotui.com" target="_blank">东莞市可用可信家庭服务有限公司</a>版权所有
				</p>
			</div>
		</div> 
	</body>
</html>